package com.gsww.vue.controller.sys;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.gsww.vue.controller.BaseController;
import com.gsww.vue.service.sys.SysOperatorService;
/**
 * <p>Copyright: Copyright (c) 2014</p>
 * <p>公司名称 : 中国电信甘肃万维公司</p>
 * <p>项目名称 : jup-web</p>
 * <p>创建时间 : 2014-6-08 下午10:55:12</p>
 * <p>类描述 :   账号管理模块控制器    </p>
 *
 * @version 3.0.0
 * @author <a href=" ">zhangtb</a>
 */
@RestController
@RequestMapping(value = "/sys")
public class SysOperatorController extends BaseController{
	private static Logger logger = LoggerFactory.getLogger(SysOperatorController.class);
	@Autowired
	private SysOperatorService sysOperatorService;

	/**
	 * 获取操作列表
	 * @param pageNumber
	 * @param pageSize
	 * @param sortType
	 * @param model
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/operatorList",method = RequestMethod.GET)
	@ResponseBody
	public Map<String,Object> operatorList(@RequestParam String  operatorName,@RequestParam String  pageNo,@RequestParam String  pageSize,
			HttpServletRequest request,HttpServletResponse response) {
		Map<String,Object> resMap = new HashMap<String,Object>();
		try{
			
			Map<String,Object> map = sysOperatorService.getOperatorList(operatorName, null,pageNo,pageSize);
			List<Map<String,Object>> list = (List<Map<String, Object>>) map.get("result");
			resMap.put("data", map);
			resMap.put("success", true);
		}catch(Exception ex){
			resMap.put("success", false); 
			ex.printStackTrace();
		}
		return resMap;
	}
	
}
